package com.baigt.juc.base;

/**
 * 类功能描述:
 * 线程钩子
 *
 * @author baigt
 * @version V1.0
 * @since 2019-10-21 10:25
 */
public class ThreadRun08 {
    /**
     *
     * @param args
     * @throws InterruptedException
     */
    public static void main(String[] args) throws InterruptedException {

        Runtime.getRuntime().addShutdownHook(new Thread(()->{
            System.out.println("我是钩子程序");
        }));
        System.out.println("main thread is stoped will");
    }

}
